<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" type="text/css" href="font/iconfont.css"/>
<link rel="stylesheet" type="text/css" href="css/common.css"/>
</head>
<body>
	<div id="immersed" class="immersed hide"></div>
	<div id="jheader" class="line-b jflex">
		<a class="header-item iconfont icon-i7 mui-action-back"></a>
		<div id="jheader-center" class="header-item">1</div>
		<a id="ricon" class="header-item  header-item-r"></a>
	</div>
	<div class="mui-loader">请稍候...</div>
</body>
<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	var contentWebview = null,self = null;
	mui.plusReady(function () {
		self = plus.webview.currentWebview();
	});
	var titleElem = document.getElementById("jheader-center");
	var riconElem=document.getElementById("ricon");
	
	/**
	 * 右侧菜单的点击事件，调用的是内容区域页面中的自定义事件，名称为riconClick
	 */
	mui('#jheader').on('tap','#ricon', function() {
		if(contentWebview==null){
			contentWebview = self.children()[0];
		}
		mui.fire(contentWebview,'riconClick',{});
	});
	mui.back = function() {
		self.hide('auto');
		setTimeout(function() {
//			titleElem.className = 'mui-fadeout';
			titleElem.innerText ='';
			riconElem.innerText='';
			if(contentWebview==null){
				contentWebview = self.children()[0];
			}
			contentWebview.hide("none");
		}, 350);
	}

	window.addEventListener("updateHeader", function(e) {
		var title = e.detail.title;
		var href = e.detail.target;
		var param=e.detail.param;
		titleElem.innerHTML = title;
		if(e.detail.ricon){
			riconElem.innerHTML=e.detail.ricon;
		}else{
			riconElem.innerHTML='';
		}
//		titleElem.className = "mui-fadein";
		
		
		if(mui.os.android&&parseFloat(mui.os.version)>=4.4){}
			if(contentWebview==null){
				contentWebview = self.children()[0];
			}
			//关闭下拉刷新
			contentWebview.setPullToRefresh({support:false});
			if (contentWebview.getURL() != href) {
				contentWebview.loadURL(href);
			} else {
				contentWebview.show();
			}
			
			setTimeout(function () {
				self.show("pop-in",300);
			},15);
		
	});
</script> 

</html>